




/*选项卡*/
window.onload = function(){
	var index = 0;
	var timer=null;
	var list1 = document.querySelectorAll('.tab-list1 li');
	var list2 = document.querySelectorAll('.tab-list2 li');
	var list3 = document.querySelectorAll('.tab-list3 li');
	var content1 = document.querySelectorAll('.list-1 .list-content');
	var content2 = document.querySelectorAll('.list-2 .list-content');
	var content3 = document.querySelectorAll('.list-3 .list-content');
	function demo(a,b){
		for (var w = 0; w < a.length; w++) {
			a[w].index = w;
			a[w].onmouseover = function() {
		        var that=this;
	    		timer=window.setTimeout(function(){
					for (var t = 0; t < a.length; t++) {
						a[t].className=''
						b[t].className = 'list-content list-box goods-list';
					}
					a[that.index].className='tab-active'
					b[that.index].className = 'list-content list-box goods-list list-active';
				},200)
			}
			a[w].onmouseout = function() {
				clearTimeout(timer)
			}
		}
	}
demo(list1, content1);
demo(list2, content2);
demo(list3, content3);
}





/*视频*/
var fig = document.querySelectorAll('.video .fig');
var close = document.querySelectorAll('.close');
var vide = document.querySelectorAll('.modal-bd video')
var modavideoBox = document.querySelectorAll('.modavideo-box')
for(var i=0;i<fig.length;i++){
	fig[i].index = i;
	fig[i].onclick=function(){
		modavideoBox[this.index].style.display = 'block';
		vide[this.index].play();
	}
}
for(var i=0;i<close.length;i++){
	close[i].index = i;
	close[i].onclick=function(){
		modavideoBox[this.index].style.display = 'none';
		vide[this.index].pause();//load()
	}
}















/*swiper插件开始*/
var banner = new Swiper('.slider-content .swiper-container', {
    spaceBetween: 30,
    effect: 'fade',
    pagination: {
        el: '.slider-content .swiper-pagination',
    	type: 'progressbar',
    },
    navigation: {
    	nextEl: '.slider-content .swiper-button-next',
    	prevEl: '.slider-content .swiper-button-prev',
    },
	loop : true,
	autoplay: {
	    delay: 3000,
	    stopOnLastSlide: false,
	    disableOnInteraction: false,
    },
});
banner.el.onmouseover = function(){
	banner.autoplay.stop();
}
banner.el.onmouseout = function(){
	banner.autoplay.start();
}
if(document.body.offsetWidth>'668'){
	var swiperPc = new Swiper('.star-box .swiper-container', {
	    navigation: {
	        nextEl: '.star-box .swiper-button-next',
	        prevEl: '.star-box .swiper-button-prev',
	    },
	});
}

if(document.body.offsetWidth<='668'){
	var swiperNe = new Swiper('.star-box .swiper-container', {
	    slidesPerView: 'auto',
	    centeredSlides: false,
	    pagination: {
	        el: '.star-box .swiper-pagination',
	        clickable: true,
	      },
	});
	var swiperNR = new Swiper('.phont-bd .swiper-container', {
      slidesPerView: 1.3,
      spaceBetween: -30,
	  centeredSlides: true,
      pagination: {
        el: '.phont-bd .swiper-pagination',
        clickable: true,
      },
    });
}
	



/*swiper插件结束*/
// 增删改查
